<template>
  <div class="notice-detail">
    <div class="notice-detail-item">
      <p>场景名称：</p>
      <p>{{ detailInfo.sceneName }}</p>
    </div>
    <div class="notice-detail-item">
      <p>应用场景：</p>
      <p>{{ detailInfo.title }}</p>
    </div>
    <div class="notice-detail-item">
      <p>业务描述：</p>
      <p>{{ detailInfo.desc }}</p>
    </div>
    <div v-if="detailInfo.amount" class="notice-detail-item">
      <p>消费金额：</p>
      <p>{{ detailInfo.amount }}</p>
    </div>
    <div v-if="detailInfo.time" class="notice-detail-item">
      <p>交易时间：</p>
      <p>{{ detailInfo.time }}</p>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      detailInfo: {}
    };
  },
  created() {
    this.initData();
  },
  methods: {
    initData() {
      let session = sessionStorage.getItem("notice_detail");
      if (session) {
        this.detailInfo = JSON.parse(session);
      }
    }
  }
};
</script>

<style lang="less" scoped>
.notice-detail {
  width: 100%;
  height: 100%;
  position: fixed;
  overflow: auto;
  background: #f1f1f1;

  .notice-detail-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    padding: 16px 12px;
    font-size: 15px;
    border-bottom: 1px solid #f1f1f1;
    p:nth-child(1) {
      color: #000;
    }
    p:nth-child(2) {
      color: #666;
    }
  }
}
p {
  margin: 0;
  padding: 0;
}
</style>
